//
//  QDComplicationCell.m
//  simulateQuickDoctor
//
//  Created by 梁家伟 on 17/3/25.
//  Copyright © 2017年 PipiXia. All rights reserved.
//

#import "QDComplicationCell.h"

@interface QDComplicationCell ()

@property(nonatomic,weak)UILabel* complicationLabel;
@property(nonatomic,weak)UIImageView* checkedImageView;

@end


@implementation QDComplicationCell



- (void)setupUI{
    
    
    
    UILabel* complicationLabel = [UILabel cz_labelWithText:@"并发症" fontSize:18 color:[UIColor blackColor]];
    [self.contentView addSubview:complicationLabel];
    
    [complicationLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).offset(8);
        make.centerY.equalTo(self.contentView);
    }];
    
    
    UIImageView* checkedImageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"icon_yy_successful"]];
    [self.contentView addSubview:checkedImageView];
    
    [checkedImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView).offset(-16);
        make.centerY.equalTo(self.contentView);
        make.size.mas_equalTo(CGSizeMake(24, 24));
    }];
    
    _complicationLabel =  complicationLabel;
    _checkedImageView = checkedImageView;
}


- (void)setModel:(QDComplicationModel *)model{
    
    _model = model;
    
    _complicationLabel.text = _model.complication_name;
    
    if(_model.isSelected){
        _checkedImageView.hidden = NO;
    }else{
        _checkedImageView.hidden = YES;
    }
    
}





@end
